//
//  LBCalendarPickerView.h
//  jslj
//
//  Created by 杨庆人 on 2018/4/9.
//  Copyright © 2018年 广东联结电子商务有限公司. All rights reserved.
//

#import <UIKit/UIKit.h>


/**
 LBCalendarSelectBlock

 @param timeStamp 时间戳，毫秒
 @param timeStr 时间字符串
 */
typedef void (^LBCalendarSelectBlock)(NSString *timeStamp, NSString *timeStr);
typedef void (^CloseBlock)(void);

typedef NS_ENUM(NSInteger,LBCalendarPickerType) {
    LBCalendarPickerSelectDateNormal,    // 默认
    LBCalendarPickerNoSelectLastDate,    // 禁止选择今天之前的时间
    LBCalendarPickerNoSelectLastAndTodayDate,    // 禁止选择今天和今天之前的时间
    LBCalendarPickerNoSelectNextDate,    // 禁止选择今天之后的时间
    LBCalendarPickerNoSelectNextAndTodayDate,    // 禁止选择今天和今天之后的时间
};

typedef NS_ENUM(NSInteger,LBCalendarTimeStampType) {
    LBCalendarTimeStampTypeDayStart,    // 当天的开始，即 00:00
    LBCalendarTimeStampTypeDayEnd,    // 当天的结束，即 23:59:59，if nil 则为此默认
};

@interface LBCalendarPickerView : UIViewController
@property (nonatomic,assign)LBCalendarPickerType type;
@property (nonatomic,assign)LBCalendarTimeStampType timeStampType;
@property (nonatomic,copy)LBCalendarSelectBlock select;
@property (nonatomic,copy)NSString *format;

/**
 日历选择器
 
 /param type LBCalendarPickerType
 @param format @"yyyy-MM-dd"，if nil 则只返回时间戳
 @param select LBCalendarSelectBlock
 */

+ (void)showWithFormat:(NSString *)format result:(LBCalendarSelectBlock)select;

+ (void)showByPickerType:(LBCalendarPickerType)type format:(NSString *)format result:(LBCalendarSelectBlock)select;

+ (void)showByPickerType:(LBCalendarPickerType)type timeStampType:(LBCalendarTimeStampType)timeStampType format:(NSString *)format result:(LBCalendarSelectBlock)select;

@end

@interface LBCalenderPopRoundView : UIView
@property (nonatomic,copy)LBCalendarSelectBlock select;
@property (nonatomic,copy)CloseBlock close;
- (instancetype)initWithFrame:(CGRect)frame type:(LBCalendarPickerType)type timeStampType:(LBCalendarTimeStampType)timeStampType format:(NSString *)format;
+ (CGFloat)viewHight;
@end

